import api from "@/api";
export default{
    //解决命名空间冲突
    namespaced:true,
    state: {
        subjects: [], //专业数据的初始值
      },
      getters: {
       
      },
      mutations: {
        SET_SUBJECTS(state, payload) {
            state.subjects = payload;
          },
      },
      actions: {
        async getSubjectsAsync(context) {
            const res = await api.subjects.get();
            if (res.code) {
              console.log(res.data );
              context.commit("SET_SUBJECTS", res.data.rows);
            }
          },
      },
    
}